using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

namespace XDLPipeline
{
    /// <summary>
    /// Writes the binary stream for a weapon definition.
    /// </summary>
    [ContentTypeWriter]
    public class WeaponSettingsWriter : 
        ContentTypeWriter<WeaponSettingsContent>
    {
        protected override void Write(ContentWriter output, WeaponSettingsContent value)
        {
            output.Write(value.Name);
            output.Write(value.Damage);
            output.Write(value.ReloadTime);
            output.Write(value.DamageType);
            output.Write(value.ContinousFire);
            output.Write(value.RecoilForce);
            output.Write(value.Radius);
            output.WriteObject(value.FireAnimationDuration);
        }

        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return "XDL.Framework.Weapons.WeaponSettings, XDL";
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return "XDL.Framework.Weapons.WeaponSettingsReader, XDL";
        }
    }
}

